The idea is the following.
Have products and services that pass through different states (order, 
committed, reviewed, approved, slope, bill, invoice), these may belong to a 
period or many (period = months).
The filter may include the client query or not.
La idea es la siguiente.
Tengo productos y servicio que pasan por distintos estados (pedido, 
comprometido,revisado, aprovado, pendiente, a facturar, facturado), estos 
pueden pertenecer a un periodo o a muchos (periodo=meses).
El filtro del query puede incluir el cliente o no.
 

    El Miércoles, 3 de febrero, 2016 12:23:31, "Thomas Steinmaurer 
t...@iblogmanager.com [firebird-support]" <firebird-support@yahoogroups.com> 
escribió:
 

     > I have a state machine (workflow) implemented on a table a couple of
> million records and growing.
> I have crated an index on the "state" field. The possible states are
> very few (5 to 10). Obviously selectivity index is terrible. As I can
> optimize the query?

Hard to say without seeing an actual query ...

Is the state field the only one used to filter the result set?

-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.
  #yiv8949947214 #yiv8949947214 -- #yiv8949947214ygrp-mkp {border:1px solid 
#d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv8949947214 
#yiv8949947214ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv8949947214 
#yiv8949947214ygrp-mkp #yiv8949947214hd 
{color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 
0;}#yiv8949947214 #yiv8949947214ygrp-mkp #yiv8949947214ads 
{margin-bottom:10px;}#yiv8949947214 #yiv8949947214ygrp-mkp .yiv8949947214ad 
{padding:0 0;}#yiv8949947214 #yiv8949947214ygrp-mkp .yiv8949947214ad p 
{margin:0;}#yiv8949947214 #yiv8949947214ygrp-mkp .yiv8949947214ad a 
{color:#0000ff;text-decoration:none;}#yiv8949947214 #yiv8949947214ygrp-sponsor 
#yiv8949947214ygrp-lc {font-family:Arial;}#yiv8949947214 
#yiv8949947214ygrp-sponsor #yiv8949947214ygrp-lc #yiv8949947214hd {margin:10px 
0px;font-weight:700;font-size:78%;line-height:122%;}#yiv8949947214 
#yiv8949947214ygrp-sponsor #yiv8949947214ygrp-lc .yiv8949947214ad 
{margin-bottom:10px;padding:0 0;}#yiv8949947214 #yiv8949947214actions 
{font-family:Verdana;font-size:11px;padding:10px 0;}#yiv8949947214 
#yiv8949947214activity 
{background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv8949947214
 #yiv8949947214activity span {font-weight:700;}#yiv8949947214 
#yiv8949947214activity span:first-child 
{text-transform:uppercase;}#yiv8949947214 #yiv8949947214activity span a 
{color:#5085b6;text-decoration:none;}#yiv8949947214 #yiv8949947214activity span 
span {color:#ff7900;}#yiv8949947214 #yiv8949947214activity span 
.yiv8949947214underline {text-decoration:underline;}#yiv8949947214 
.yiv8949947214attach 
{clear:both;display:table;font-family:Arial;font-size:12px;padding:10px 
0;width:400px;}#yiv8949947214 .yiv8949947214attach div a 
{text-decoration:none;}#yiv8949947214 .yiv8949947214attach img 
{border:none;padding-right:5px;}#yiv8949947214 .yiv8949947214attach label 
{display:block;margin-bottom:5px;}#yiv8949947214 .yiv8949947214attach label a 
{text-decoration:none;}#yiv8949947214 blockquote {margin:0 0 0 
4px;}#yiv8949947214 .yiv8949947214bold 
{font-family:Arial;font-size:13px;font-weight:700;}#yiv8949947214 
.yiv8949947214bold a {text-decoration:none;}#yiv8949947214 dd.yiv8949947214last 
p a {font-family:Verdana;font-weight:700;}#yiv8949947214 dd.yiv8949947214last p 
span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv8949947214 
dd.yiv8949947214last p span.yiv8949947214yshortcuts 
{margin-right:0;}#yiv8949947214 div.yiv8949947214attach-table div div a 
{text-decoration:none;}#yiv8949947214 div.yiv8949947214attach-table 
{width:400px;}#yiv8949947214 div.yiv8949947214file-title a, #yiv8949947214 
div.yiv8949947214file-title a:active, #yiv8949947214 
div.yiv8949947214file-title a:hover, #yiv8949947214 div.yiv8949947214file-title 
a:visited {text-decoration:none;}#yiv8949947214 div.yiv8949947214photo-title a, 
#yiv8949947214 div.yiv8949947214photo-title a:active, #yiv8949947214 
div.yiv8949947214photo-title a:hover, #yiv8949947214 
div.yiv8949947214photo-title a:visited {text-decoration:none;}#yiv8949947214 
div#yiv8949947214ygrp-mlmsg #yiv8949947214ygrp-msg p a 
span.yiv8949947214yshortcuts 
{font-family:Verdana;font-size:10px;font-weight:normal;}#yiv8949947214 
.yiv8949947214green {color:#628c2a;}#yiv8949947214 .yiv8949947214MsoNormal 
{margin:0 0 0 0;}#yiv8949947214 o {font-size:0;}#yiv8949947214 
#yiv8949947214photos div {float:left;width:72px;}#yiv8949947214 
#yiv8949947214photos div div {border:1px solid 
#666666;height:62px;overflow:hidden;width:62px;}#yiv8949947214 
#yiv8949947214photos div label 
{color:#666666;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv8949947214
 #yiv8949947214reco-category {font-size:77%;}#yiv8949947214 
#yiv8949947214reco-desc {font-size:77%;}#yiv8949947214 .yiv8949947214replbq 
{margin:4px;}#yiv8949947214 #yiv8949947214ygrp-actbar div a:first-child 
{margin-right:2px;padding-right:5px;}#yiv8949947214 #yiv8949947214ygrp-mlmsg 
{font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv8949947214 
#yiv8949947214ygrp-mlmsg table {font-size:inherit;font:100%;}#yiv8949947214 
#yiv8949947214ygrp-mlmsg select, #yiv8949947214 input, #yiv8949947214 textarea 
{font:99% Arial, Helvetica, clean, sans-serif;}#yiv8949947214 
#yiv8949947214ygrp-mlmsg pre, #yiv8949947214 code {font:115% 
monospace;}#yiv8949947214 #yiv8949947214ygrp-mlmsg * 
{line-height:1.22em;}#yiv8949947214 #yiv8949947214ygrp-mlmsg #yiv8949947214logo 
{padding-bottom:10px;}#yiv8949947214 #yiv8949947214ygrp-msg p a 
{font-family:Verdana;}#yiv8949947214 #yiv8949947214ygrp-msg 
p#yiv8949947214attach-count span {color:#1E66AE;font-weight:700;}#yiv8949947214 
#yiv8949947214ygrp-reco #yiv8949947214reco-head 
{color:#ff7900;font-weight:700;}#yiv8949947214 #yiv8949947214ygrp-reco 
{margin-bottom:20px;padding:0px;}#yiv8949947214 #yiv8949947214ygrp-sponsor 
#yiv8949947214ov li a {font-size:130%;text-decoration:none;}#yiv8949947214 
#yiv8949947214ygrp-sponsor #yiv8949947214ov li 
{font-size:77%;list-style-type:square;padding:6px 0;}#yiv8949947214 
#yiv8949947214ygrp-sponsor #yiv8949947214ov ul {margin:0;padding:0 0 0 
8px;}#yiv8949947214 #yiv8949947214ygrp-text 
{font-family:Georgia;}#yiv8949947214 #yiv8949947214ygrp-text p {margin:0 0 1em 
0;}#yiv8949947214 #yiv8949947214ygrp-text tt {font-size:120%;}#yiv8949947214 
#yiv8949947214ygrp-vital ul li:last-child {border-right:none 
!important;}#yiv8949947214 

  
  • [firebird-supp... Germán Balbi bal...@yahoo.com [firebird-support]
    • Re: [fire... Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
      • Re: [... Germán Balbi bal...@yahoo.com [firebird-support]

Reply via email to